x86: Move microcode loading earlier
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Tue, 18 Apr 2017 15:47:24 +0000 (16:47 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 19 Apr 2017 16:08:01 +0000 (17:08 +0100)
commitf97838bbd980a0104e16c4a12fbf514f9fa805f1
tree5971dea907bef98cc21730a57d2807fa877f6f46
parent5d1ad47ff7940d95c322667678a190c8607754b4
x86: Move microcode loading earlier

Move microcode loading earlier for the boot CPU and secondary CPUs so
that it takes place before identify_cpu() is called for each CPU.
Without this, the detected features may be wrong if the new microcode
loading adjusts the feature bits. That could mean that some fixes (e.g.
d6e9f8d4f35d ("x86/vmx: fix vmentry failure with TSX bits in LBR"))
don't work as expected.

Previously during boot, the microcode loader was invoked for each
secondary CPU started and then again for each CPU as part of an
initcall. Simplify the code so that it is invoked exactly once for each
CPU during boot.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-acked-by: Julien Grall <julien.grall@arm.com>
xen/arch/x86/Makefile
xen/arch/x86/cpu/common.c
xen/arch/x86/microcode.c
xen/arch/x86/microcode_amd.c
xen/arch/x86/microcode_intel.c
xen/arch/x86/setup.c
xen/arch/x86/smpboot.c
xen/include/asm-x86/processor.h
xen/include/xen/smp.h